/**
 * 
 */
package com.jushu.storbox.service;

import java.util.List;
import java.util.HashMap;

import android.content.Context;
import android.os.Handler;

import com.jushu.storbox.entities.FileFolderInfo;
import com.jushu.storbox.entities.FileInfo;
import com.huawei.sharedrive.sdk.android.modelV2.response.FileInfoResponseV2;

public interface ILocalFileService extends ILocalService{
	/**
	 * @param fileInfo
	 * @param context
	 */
	public long insertFile(FileInfoResponseV2 fileInfo);

	/**
	 * @param fileInfo
	 */
	public void updateFile(FileInfoResponseV2 fileInfoResponse);
	
	/**
	 * @param fileInfo
	 */
	public void updateFile(FileInfoResponseV2 fileInfoResponse, boolean resetFileDownloadState, boolean syncIdentity);

	/**
	 * @param fileInfo
	 */
	public void updateFile(FileInfo fileInfo);

	/**
	 * @param fileInfo
	 */
	public void inserOrUpdateFile(FileInfoResponseV2 fileInfo);

	/**
	 * @param folderId
	 * @return
	 */
	public List<FileInfo> getFileList(FileFolderInfo info);
	
	public List<FileInfo> getFileList(String ownerId, String resId);
	
	public HashMap<String, FileInfo> getMappedFileList(String ownerId, String folderId);
	
	/**
	 * @param currentPage
	 * @param folderId
	 * @return
	 */
	public List<FileInfo> getFileListPage(String ownerId, String folderId);

	/**
	 * @param fileId
	 * @return
	 */
	public FileInfo getFileById(FileFolderInfo info);
	
	/***
	 * @param context
	 * @param folderID
	 * @param des
	 * @param orderby
	 * @return
	 */
	public List<FileFolderInfo> getFileFolderInfos(Context context,
			String ownerId, String folderID, String des, String orderby);

	/**
	 * @param id
	 */
	public void deleteFile(FileFolderInfo fileFolderInfo);
	
	/**
	 * @param id
	 */
	public void deleteFileVirtual(FileFolderInfo info);

	/**
	 * @param serverInfo
	 * @param localInfo
	 * @return
	 */
	public FileFolderInfo renameFile(FileInfoResponseV2 serverInfo, FileFolderInfo localInfo);

	/**
	 * @param file
	 * @param targetFolder
	 */
	public void moveFile(FileFolderInfo file, FileFolderInfo targetFolder);

	/**
	 * @param folderName
	 */
	public void syncFile(FileFolderInfo info,String fileName);
	
	/**
	 * @param folderId
	 * @param folderName
	 */
	public void cancelSyncFile(FileFolderInfo info, String fileName);
	
	/**
	 * 
	 * @param fileId
	 * @param localPath
	 */
	public void updateLocalPath(FileFolderInfo info, String localPath);

	/**
	 * 
	 * @param status
	 * @param fileId
	 */
	public void updateTransStatus(FileFolderInfo info, int status);

	/**
	 * @param syncStatus
	 * @param fileId
	 */
	public void updateSyncStatus(FileFolderInfo info, int syncStatus);
	
	public void getCloudDriveCache(Handler handler);
	
	/**
	 * @param handler 
	 */
	public void clearCloudDriveCache(Handler handler);
	
//	boolean operateWhenMobileIsRoot();
	public List<FileFolderInfo> searchInDB(String ownerId, String fileName,Context context);
}
